package com.brillilab.service.module.message.template.impl.usercenter;

import com.brillilab.service.module.message.template.AbstractMessageTemplate;
import com.brillilab.service.module.message.template.enums.MessageTypeEnum;
import lombok.Data;

import java.util.Map;

/**
 * @author zlb
 * @Title: AuthByModifySuccessTemplate
 * @ProjectName brill_lab
 * @Description: 权限被修改成功-模板
 * @date 2019/5/27 14:51
 */
@Data
public class AuthByModifySuccessTemplate extends AbstractMessageTemplate {

    private String operator;

    /**
     *  跳转信息，referId此处为被添加用户的用户Id
     */

    /**
     *  权限被修改
     * @param labId 实验室ID
     * @param receiverId 接收人ID
     * @param labMemberId 接收者实验室成员Id
     * @param operator 操作人姓名
     * @param referId 业务关联ID
     */
    public AuthByModifySuccessTemplate(Long labId, Long receiverId,Long labMemberId,String operator,Long referId) {
        super(labId, receiverId);
        super.setType(MessageTypeEnum.AuthByModifySuccess.getValue());
        super.setTitle("您的权限已被修改");
        String content=String.format(
                "<span>您的权限已被</span>" + "<span style='color:#F6AC2D'>%s</span>" + "<span>修改</span>"
                ,operator);
        super.setContent(content);
        super.setAppContent(String.format("您的权限已被%s修改",operator));
        this.labMemberId=labMemberId;
        this.operator=operator;
        this.referId=referId;
    }

    public AuthByModifySuccessTemplate(Long labId,Map<Long,Long> receivers,String operator) {
        super(labId, 0L);
        super.setType(MessageTypeEnum.AuthByModifySuccess.getValue());
        super.setTitle("您的权限已被修改");
        String content=String.format(
                "<span>您的权限已被</span>" + "<span style='color:#F6AC2D'>%s</span>" + "<span>修改</span>"
                ,operator);
        super.setContent(content);
        super.setReceiverMap(receivers);
        super.setAppContent(String.format("您的权限已被%s修改",operator));
        this.operator=operator;
        this.referId=0L;
    }
}
